package com.sdkj.fixed.asset.common.utils;/*

package com.sdkj.cloud.common.utils;

import org.apache.commons.lang3.ObjectUtils;

import javax.servlet.http.HttpServletRequest;

*/
/**
 * ip工具类
 *
 * @author fengshuonan
 * @Date 2018/9/27 上午10:47
 *//*

public class IpUtils {

    */
/**
     * 获取客户端IP地址
     *
     * @author fengshuonan
     * @Date 2018/9/27 上午10:47
     *//*

    public static String getRemoteAddr(HttpServletRequest request) {
        if (request == null) {
            return "unknown";
        }
        String ip = request.getHeader("X-Forwarded-For");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("X-Real-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        return StringUtils.split(ObjectUtils.toString(ip), ",")[0];
    }

}  */
